﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BeatingMole
{
    /// <summary>
    /// Nguyễn Đặng Anh Duy
    /// MSSV : 11100204
    /// Email : itc.anhduy@gmail.com
    /// <summary>
    class CBusPlayer
    {
        #region "Variable"
        ContentManager _Content;
        CInfoPlayer _infoPlayer;       
        #endregion

        #region "Properties"
        public CInfoPlayer InfoPlayer
        {
            set { _infoPlayer = value; }
            get { return _infoPlayer; }
        }
        #endregion

        #region "Constructor"
        public CBusPlayer(ContentManager content)
        {
            _Content = content;
            InfoPlayer = new CInfoPlayer(_Content);
        }
        #endregion

        #region "Method"
        public void Attach()
        {
           
        }

        public void UpdateScore()
        {
 
        }           

        public void UpdatePlayer(GameTime gameTime)
        {
            CGlobalVariable.InfoPlayer.Score = CGlobalVariable.Score;
        }

        public void DrawPlayer(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(CGlobalVariable.InfoPlayer.Avatar, new Vector2(5, 2), Color.White);
        }

        public void DrawNamePlayer(SpriteBatch spriteBatch)
        {
            spriteBatch.DrawString(CGlobalVariable.InfoPlayer.SpriteFontPlayer, CGlobalVariable.InfoPlayer.Name, new Vector2(CGlobalVariable.InfoPlayer.Avatar.Width + 8, 2), Color.White);
        }

        public void DrawScorePlayer(SpriteBatch spriteBatch)
        {
            spriteBatch.DrawString(CGlobalVariable.InfoPlayer.SpriteFontPlayer, "Điểm : " + CGlobalVariable.InfoPlayer.Score.ToString(), new Vector2(CGlobalVariable.InfoPlayer.Avatar.Width + 8, 28), Color.White);
        }
        #endregion
    }
}
